When drilling a wellbore in a formation, drilling fluid is circulated from a surface location to a downhole location by being pumped downward through an inside of a drill string and back to the surface by flowing upward in an annulus between the drill string and the wellbore. When pumping stops, a certain amount of drill fluid, often between 20 to 50 barrels, flows back to the fluid holding tanks due to elasticity of the formation. This is known as flowback. Such flowback, when shutting off the pumps is considered normal. However, an amount of flowback higher or lower than expected may occur depending on characteristics of the formation. “Kick” refers to the higher than expected flowback situation while “loss” refers to the lower than expected flowback situation. A kick may occur during such occasions in which fluid flows into the wellbore from the formation. If this formation fluid flow into the wellbore occurs in an uncontrollable manner, an undesirable event referred to as a blowout may occur. In a loss situation, drill fluid may flow from the wellbore into crevices and crack in the formation caused by drilling. Thus, early detection of kicks or losses is of particular interest to drilling operators.